package helpers;

import java.util.Map;


public class Constants {

    public static String getValue(Map<Integer, String> items, int key) {
        if (items.containsKey(key)) {
            return items.get(key);
        } else {
            return "-";
        }
    }

    public static final int USER_ROLE_ADMIN = 1;
    public static final int USER_ROLE_TEST = 2;
    public static final int USER_ROLE_STAFF = 3; //员工


    private static Map<Integer, String> getUserRole() {
        Map<Integer, String> items = null;
        items.put(USER_ROLE_ADMIN, "管理员");
        items.put(USER_ROLE_TEST, "测试");
        items.put(USER_ROLE_STAFF, "员工");
        return items;
    }

    public static String getUserRole(int key) {
        return getValue(getUserRole(), key);
    }

    public static final int USER_STATE_ACTIVE = 1;
    public static final int USER_STATE_FORBIDDEN = 2;

    public static Map<Integer, String> getUserState() {
        Map<Integer, String> items = null;
        items.put(USER_STATE_ACTIVE, "正常");
        items.put(USER_STATE_FORBIDDEN, "冻结");
        return items;
    }

    public static String getUserState(int key) {
        return getValue(getUserState(), key);
    }

}
